<%@ page import="com.demo.bean.Student" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: WuLiangHang
  Date: 2021/3/9
  Time: 14:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%

    List<Student> list = new ArrayList<>();
    for (int i = 1; i <= 10; i++) {
        list.add(new Student(i, "name" + i, i + 10, "phone" + i));
    }
%>
<table style="border: 1px solid blue">
    <tr>
        <td>ID</td>
        <td>姓名</td>
        <td>年龄</td>
        <td>电话</td>
    </tr>
    <%
        for (Student s :
                list) {
    %>
    <tr>
        <td><%=s.getId()%>
        </td>
        <td><%=s.getName()%>
        </td>
        <td><%=s.getAge()%>
        </td>
        <td><%=s.getPhone()%>
        </td>
    </tr>
    <%
        }
    %>

</table>
</body>
</html>
